﻿using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Microsoft.Windows.Design.Interaction;
using Microsoft.Windows.Design.Model;

namespace Peer2PeerControlLibraryWPF.VisualStudio.Design
{
   
    public partial class FileControlDesignTimeControl : System.Windows.Controls.UserControl
    {
        public static readonly RoutedEvent ClosePopupEvent = EventManager.RegisterRoutedEvent("CloseFilePopupEvent", RoutingStrategy.Direct, typeof(RoutedEventHandler), typeof(ChatControlDesignTimeControl));

        public FileControlDesignTimeControl()
        {
            InitializeComponent();
            
        }

       
        public event RoutedEventHandler ClosePopup
        {
            add { AddHandler(ClosePopupEvent, value); }
            remove { RemoveHandler(ClosePopupEvent, value); }
        }

        protected void RaiseSelectionChangedEvent()
        {
            RoutedEventArgs newEventArgs = new RoutedEventArgs(FileControlDesignTimeControl.ClosePopupEvent);
            RaiseEvent(newEventArgs);
        }

        private void ItemsControl_Click(object sender, RoutedEventArgs e)
        {
            RaiseSelectionChangedEvent();
        }

        public ComboBox StatusLogCombobox
        {
            get { return mStatusLogCombobox; }
        }

        public ComboBox SendFileCombobox
        {
            get{ return mSendFileCombobox;}
        }

       
        private void _SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if(e.AddedItems.Count == 1)
            {
                RaiseSelectionChangedEvent();
            }
        }
    }
}